package com.iussoft.receiveData.ftp;

import com.iussoft.ftp.FTPClientTemplate;
import com.iussoft.ftp.FTPConfigProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

/**
 * @description: FTP操作接品
 * @author: Hou Dayu
 * @date: Created in 2020/3/3
 */
//@Service("ftpManager")
public class FtpManager {

    @Autowired(required = false)
    @Qualifier("ftpConfig")
    private FTPConfigProperties ftpConfig;//在RedisManagerImpl类中定义的

    private FTPClientTemplate ftpClientTemplate;

    //@Bean("ftpConnectionBean")
    public Object initFTPClientTemplate(){
        ftpClientTemplate = new FTPClientTemplate(ftpConfig);
        return ftpClientTemplate;
    }

    public FTPClientTemplate getFtpClientTemplate() {
        return ftpClientTemplate;
    }
}
